package one.stand.mapper;

import one.stand.model.GoodsKillModel;
import one.stand.model.GoodsModel;
import one.stand.response.essay.CompanyGoodsResponse;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author Administrator
 */
public interface GoodsMapper {
    int deleteByPrimaryKey(Integer goodsId);

    int insertSelective(GoodsModel record);

    int insertGoodsPhoto(GoodsModel record);

    GoodsModel selectByPrimaryKey(Integer goodsId);

    int updateByPrimaryKeySelective(GoodsModel record);

    int delGoodPhoto(Integer goodsId);

    List<GoodsModel> selectGoodsInfo(GoodsModel record);

    List<GoodsModel> getGoodsInfo(GoodsModel record);

    Integer selectGoodsCount(Integer goodsId);

    GoodsModel getThanGoodsInfo(GoodsModel record);

    Integer getGoodsInfoSortMax(GoodsModel record);

    int moveGoodsInfo(GoodsModel record);

    int updateTimingAssembleGoods(Date date);

    int updateTimingKillGoods(Date date);

    /**
     * 修改秒杀开始状态
     * @param date
     * @return
     */
    int updateGoodsKillStartState(Date date);

    /**
     * 修改拼团开始状态
     * @param date
     * @return
     */
    int updateGoodsAssembleStartState(Date date);

    /**
     * 取消拼团活动
     * @param goodsId 商品ID
     */
    int cancelAssembleActivities(Integer goodsId);


    /**
     * 取消秒杀活动
     * @param goodsId 商品ID
     */
    int cancelKillActivities(Integer goodsId);

    /**
     * 获取秒杀商品信息
     * @param killGoodIdList
     * @return
     */
    List<GoodsKillModel> selectKillGoodsList(@Param("killGoodIdList") List<Integer> killGoodIdList);

    List<CompanyGoodsResponse> getCompanyGoodsInfo(Integer goodstypeId);
}
